# frozen_string_literal: true

# require 'sinatra'
# require 'sinatra/namespace'
# require 'mongoid'
# require 'kaminari'
# require 'kaminari/mongoid'
# require 'dotenv/load'
# require 'oj'
# require 'require_all'
require 'bundler/setup'
Bundler.require :default
Dotenv.load
Mongoid.load!(File.join(File.dirname(__FILE__), 'config', 'mongoid.yml'))
require_rel %w[libs helpers models controllers seeds config/initializers]
# Command for reload models in console
def rel!
  Dir.glob('models/*.rb').each { |m| load m }
  Dir.glob('libs/*.rb').each { |m| load m }
  Dir.glob('helpers/*.rb').each { |m| load m }
  puts '##All models reloaded!##'
end
